# $Id$
# Maintainer: Ronald van Haren <ronald@archlinux.org>
# Contributor: Simo Leone <simo@archlinux.org>

pkgname=habak
pkgver=0.2.5
pkgrel=5
pkgdesc="A background changing app"
url="http://fvwm-crystal.org"
license=('GPL2')
depends=('imlib2')
source=("http://download.gna.org/fvwm-crystal/habak/$pkgver/$pkgname-$pkgver.tar.gz")
arch=('i686' 'x86_64')
options=('!makeflags')
md5sums=('bee5c394989367f7a4c5cb9ec99d307c')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"
  sed -i 's|^\(LDFLAGS.*$\)|\1 -lX11|' src/Makefile
}

build() {
  cd "$srcdir/$pkgname-$pkgver"
  export LDFLAGS=${LDFLAGS/,--sort-common,--as-needed//}
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  install -m755 -D habak "$pkgdir/usr/bin/habak"
}
